<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="test">
        <input type="button" value="点击" @click="dofunc(520,'Gnar')">
        <input type="text" @keyup.enter="sayHello">
    </div>
</body>
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
<script>
    var test = new Vue({
        el:"#test",
        methods:{
            dofunc:function(num,text){
                alert("方法执行!"+"+"+num+text);
            },
            sayHello:function(){
                alert("Kindred is so cute!");
            }
        }
    })
</script>
</html>